<?php

class APPCore_Form_Decorator_Outline extends Zend_Form_Decorator_Abstract
{
    /**
     * Render html of element after decorator
     *
     * @param string $content
     * @return string
     */
    public function render($content)
    {
        $element = $this->getElement();

        /**
         * Get name of element
         */
        $nameElement = $element->getName();

        /**
         * Decorator of element
         */
        $element->setDecorators(array(
            'ViewHelper',
            'Description',
            'Errors',
            array(array('data' => 'HtmlTag'), array('tag' => 'div', 'id' => $nameElement.'-element')),
            array('Label', array('tag' => 'div')),
            array(array('td' => 'HtmlTag'), array('tag' => 'td', 'colspan' => '2')),
            array(array('tr' => 'HtmlTag'), array('tag' => 'tr', 'class' => 'bg-tr'))
        ));

        return $element->__toString();
    }

}